////
//// Created by lfm on 2025/3/3.
////
#include <iostream>
using namespace std;
class Person
{
public:
    Person(string name, int age)
    {
        m_Name = name;
        m_Age = age;
    }

    bool operator==(Person& p)
    {
        if (m_Name == p.m_Name && m_Age == p.m_Age)
        {
            return true;
        }
        return false;
    }

    bool operator!=(Person& p)
    {
        if (m_Name == p.m_Name && m_Age == p.m_Age)
        {
            return false;
        }
        return true;
    }


    string m_Name;
    int m_Age;
    //重载 == 号
};
void test01()
{
    Person p1("Tom", 19);

    Person p2("Tom", 18);

    if (p1 == p2)
    {
        cout << "p1 和 p2 是相等的" << endl;
    }
    else
    {
        cout << "p1 和 p2 不相等" << endl;
    }
}
int main()
{
    test01();
    return 0;
}